#include <stdio.h>

int main()
{
    int a, b, input, ret;
    a = 0;
    b = 0;
    while(1)
    {
        scanf("%d", &input);
        if(input < 0)
            break;
        (input % 2 == 0) ? (a += input) : (b += input);
    }
    printf("%d, %d", a, b);
    return 0;
}